package com.facebook.games.fa.model
{
	import flash.utils.ByteArray;
	
	import mx.collections.ArrayCollection;
	
	import spark.collections.Sort;
	import spark.collections.SortField;

	/**
	 * Equipe
	 * @author Diego Maehler <dmaehler@gmail.com>
	 */
	[Bindable]
	public class Team
	{
		
		public var id : int;
		
		/**
		 * Nome
		 */
		public var name : String;
		
		/**
		 * Logo da equipe
		 */
		public var logo : ByteArray;
		
		/**
		 * Atletas da equipe
		 */
		public var athletes : ArrayCollection = new ArrayCollection();
		
		/**
		 * Ordena pelo nome os atletas
		 */
		public function sortAthletes():void
		{
			athletes.sort = new Sort();
			athletes.sort.fields = [new SortField("name")];
			athletes.refresh();
		}
	}
}